package com.laoli.controller;

import com.laoli.model.PromotionAd;
import com.laoli.service.AdService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 李
 * @Date: 2022/03/15/8:30
 * @Description:
 */
@RequestMapping("ad")
@CrossOrigin//解决跨域
@RestController
public class AdController {
    @Autowired
    private AdService service;
    @GetMapping("getAdBySpaceId/{spaceid}")
    List<PromotionAd> getAdBySpaceId(@PathVariable("spaceid") Integer sid){
        return service.getAdBySpaceId(sid);
    }
}
